<?php
/**
 * Mathematical Operations
 * Addition, +, 5+2 = 7
 * Subtraction, -, 5-2 = 3
 * Multiplication, *, 5*2 = 10
 * Division, /, 5/2 = 2.5
 * Modulus, %, 5%2 = 1
 * 
 * Short Hand Operations
 * $variable++;     Adds 1 to the variable
 * $variable--;     Subtracts 1 from the variable
 * $variable += #   Adds # to the variable
 * $variable -= #   Subtracts # from the variable
 * $variable *= #   Multiplies the variable by #
 * $variable /= #   Divides the variable by #
 * $variable %= #   Calculates the modulus of variable % #
 */
 
$firstVariable = 'Hello world'; # this is a variable containing a string
echo $firstVariable;
 
$secondVariable = 5; // this is a variable containing a number
$thirdVariable = 1.5; /** this is a variable containing a floating point **/
 
/**
 * now let's add some variables
 * together!
 */
$fourthVariable = $secondVariable + $thirdVariable;
echo $fourthVariable;
 
$fourthVariable += 7; // equivalent to $fourthVariable = $fourthVariable + 7
$fourthVariable++; // equivalent to $fourthVariable = $fourthVariable + 1
 
echo 5*2+4; // 14
echo 5+2*4; // 13
echo (5*2+4)-(5+2*4); // 1
echo (6*(2-4/2)+9)/(4/6+2); // 3.375
echo 1/0; // Error, can't divide by zero!
 
?>
